/*
* @Author: Administrator
* @Date:   2019-08-18 12:56:09
* @Last Modified by:   Administrator
* @Last Modified time: 2019-08-18 14:20:51
*/



var indexController = {
	showIndex(request, response){

		response.json({id: 1, 'name': 'andy', 'infos': 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem, dolor, error recusandae, ducimus repellat omnis dicta molestias maxime odio cumque a possimus unde. Aspernatur, perspiciatis beatae eligendi unde expedita perferendis.'});
	},

	login(request, response){
		response.render('login.html')
	},

	loginCheck(request, response){
		var username = request.body.username;
		var password = request.body.password;
		console.log( username );
		console.log( password );

		console.log( request.file );
		// if( username === 'andy' && password === 'admin88'){
		// 	request.session.userInfo = {username}
		// 	response.redirect('/profile');

		// }else{
		// 	response.redirect('/login');
		// }

		response.send('file');

	},

	logout(request, response){
		request.session.userInfo = null;
		response.redirect('/');
	}
}

module.exports = indexController